Skip to content

[Auto] Add unit tests for craftd-core#104

Closed
rviannaoliveira wants to merge 13 commits intomainfrom
cover/test-2
Closed

[Auto] Add unit tests for craftd-core#104
rviannaoliveira wants to merge 13 commits intomainfrom
cover/test-2

Conversation

@rviannaoliveira
Copy link
Copy Markdown
Contributor

Auto-generated Unit Tests

Este PR foi gerado automaticamente pelo workflow Auto Generate Cover+Test usando a Claude API.

Evolução de cobertura

Arquivos Cobertura
Antes 16 / 19 84%
Depois 19 / 19 100%

Arquivos cobertos

CraftDContentScaleTest.kt,CraftDComponentKeyTest.kt ImagePropertiesTest.kt

Como funciona

  1. Um PR tocou arquivos em android_kmp/craftd-core
  2. Após o CI passar, o workflow escaneou todos os arquivos sem cobertura
  3. Claude gerou testes JUnit4 + MockK para cada arquivo
  4. Este PR foi criado automaticamente com o resultado

Checklist de revisão

  • Testes compilam sem erros (./gradlew testDebugUnitTest)
  • Testes cobrem os principais caminhos de lógica
  • Edge cases tratados (null, vazio, JSON inválido)

Triggered by PR #102

rviannaoliveira and others added 13 commits April 11, 2026 17:52
…ifacts

Scoped change to Android/KMP only (iOS and Flutter out of scope).
Generated proposal.md, design.md, specs/craftd-image/spec.md and tasks.md.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rule 11: every new component must have a working example in the
corresponding sample app (app-sample-android for Compose and XML).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add section 6 with tasks to register and demonstrate CraftDImage
in app-sample-android for both Compose and XML setups.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove PostToolUse/Edit hook and build-on-task-complete.sh.
Add explicit rule: run ./gradlew build before marking task [x].

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Define parallel agent strategy in CLAUDE.md: core (sequential) →
compose+xml (parallel) → docs/sample → revisor.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add IMAGE_COMPONENT to CraftDComponentKey enum
- Add CraftDContentScale enum (CROP, FIT, FILL_BOUNDS, FILL_WIDTH, FILL_HEIGHT, INSIDE, NONE)
- Add ImageProperties data class with url, contentScale, contentDescription, actionProperties

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Compose:
- Add toContentScale() extension mapping CraftDContentScale → ContentScale
- Add CraftDImage composable with injectable imageLoader lambda
- Add CraftDImageBuilder with injectable imageLoader constructor param

XML:
- Add CraftDImageComponent (AppCompatImageView wrapper)
- Add CraftDImageComponentRender with injectable imageLoader
- Register CraftDImageComponentRender in CraftDBuilderManager via optional imageLoader param

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Unit tests for ImageProperties serialization, toContentScale() and CraftDImageBuilder key
- Updated docs/how-to-use/compose.md and view-system.md with CraftDImage usage examples
- Registered CraftDImageBuilder (Coil) in Compose sample and CraftDImageComponentRender (Picasso) in XML sample
- Added CraftDImage entry to dynamic.json
- Switched app-sample-android to local craftd-xml project dependency
- Added Coil 2.6.0 to libs.versions.toml
- Deleted notes.md after context consumed

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

🦙 MegaLinter status: ⚠️ WARNING

Descriptor Linter Files Fixed Errors Warnings Elapsed time
⚠️ KOTLIN detekt yes 148 no 4.68s
⚠️ MARKDOWN markdown-table-formatter 51 1 0 0.35s
⚠️ YAML prettier 18 1 4 0.98s

See detailed report in MegaLinter reports

You could have the same capabilities but better runtime performances if you use a MegaLinter flavor:

MegaLinter is graciously provided by OX Security

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant